package com.wangnan.controller;

import com.api2.User;
import com.wangnan.service.RestService;
import com.wangnan.service.UserConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource
    UserConsumerService userConsumerService;

    @Autowired
    RestService rest;

    @GetMapping("/isAlive")
    public String isAlive(){
        return userConsumerService.isAlive();
    }

    @GetMapping("/isAlive2")
    public String isAlive2(){
        return rest.isAlive();
    }

    @GetMapping("/getById")
    public User getById(Integer id){
        return  userConsumerService.getById(id);
    }
}
